#include "open_ringbuffer.h"

int main(void)
{
    int ret = OPRB_OK;
    ret = oprb_writeline("[2023-07-10 14:22:01][BOOT][Warn]: UBoot failed,compare key hash failed.\n");
    if( ret < 0) printf("oprb_writeline error code = %d\n", ret);

    ret = oprb_writeline("[2023-07-10 14:30:08][BOOT][Warn]: AVB check failed. \n");
    if( ret < 0) printf("oprb_writeline error code = %d\n", ret);

    ret = oprb_writeline("[2023-07-10 14:36:25][Kernel][Warn] : Username or password failed.\n");
    if( ret < 0) printf("oprb_writeline error code = %d\n", ret);

    ret = oprb_writeline("[2028-07-11 10:30:06][Flash][Warn] : Flash failed ,signature check failed.\n");
    if( ret < 0) printf("oprb_writeline error code = %d\n", ret);

    char logline[1000];      

    while((ret = oprb_readline(logline, 1000)) >= 0)
    {
        printf("%s", logline);
    }
    printf("oprb_readline return code =%d\n", ret);

    return 0;
}